package com.easyattendance.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="tbl_AttendanceTakenBy")
@IdClass(AttendanceTakenByPK.class)
public class AttendanceTakenBy {
	
		@Id
		@Column(name="attendance_date",nullable=false)
		private Date attendance_date;
		
		@Id
		@Column(name="class_id",length=15,nullable=false)
		private String class_id;
		
		@Column(name="teacher_id")
		private String teacher_id;  
		
		@ManyToOne
		@JoinColumn(name="class_id",insertable=false,updatable=false)
		private Class classObj;
		
		@ManyToOne
		@JoinColumn(name="teacher_id",insertable=false,updatable=false)
		private Teacher teacher;
		
		public AttendanceTakenBy()
		{
			
		}

		public AttendanceTakenBy(Date attendance_date, String class_id,
				String teacher_id) {
			super();
			this.attendance_date = attendance_date;
			this.class_id = class_id;
			this.teacher_id = teacher_id;  
		} 

		public Date getAttendance_date() {
			return attendance_date;
		}

		public void setAttendance_date(Date attendance_date) {
			this.attendance_date = attendance_date;
		}

		public String getClass_id() {
			return class_id;
		}

		public void setClass_id(String class_id) {
			this.class_id = class_id;
		}

		public String getTeacher_id() {
			return teacher_id;
		}

		public void setTeacher_id(String teacher_id) {
			this.teacher_id = teacher_id;
		} 

		
		public Class getClassObj() {
			return classObj;
		}

		public void setClassObj(Class classObj) {
			this.classObj = classObj;
		}

		public Teacher getTeacher() {
			return teacher;
		}

		public void setTeacher(Teacher teacher) {
			this.teacher = teacher;
		}
}
